<title>图片切换</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width" />

<button onclick="show1()">1</button>
<button onclick="show2()">2</button>
<button onclick="show3()">3</button>
<button onclick="show4()">4</button>
<button onclick="show5()">5</button>

<button onclick="prev()">һ</button>
<button onclick="next()">һ</button>

<button onclick="da()"></button>
<button onclick="xiao()">С</button>
<hr />

<img width="300" id="pic" src="1.jpg" />

<script>
var i=1;
var w=300;

function prev(){
  i--;
  if(i==0)  i=5;
  pic.src=i+".jpg";
}
function next(){
  i++;
  if(i==6)  i=1;
  pic.src=i+".jpg";
}
function da(){
  w=w*1.1;
  pic.width = w;
}
function xiao(){
  w=w/1.1;
  pic.width = w;
}
function show1(){
  pic.src="1.jpg";
  i=1;
}
function show2(){
  pic.src="2.jpg";
  i=2;
}
function show3(){
  pic.src="3.jpg";
  i=3;
}
function show4(){
  pic.src="4.jpg";
  i=4;
}
function show5(){
  pic.src="5.jpg";
  i=5;
}

</script>




